package ComposicaoNotaFiscalEndereco;

import org.nakedobjects.extended.Entity;
import org.nakedobjects.object.AbstractNakedObject;
import org.nakedobjects.object.Title;
import org.nakedobjects.object.collection.ExtendedInternalCollection;
import org.nakedobjects.object.value.TextString;

@Entity
public class Endereco extends AbstractNakedObject {
	
	private TextString linha1 = new TextString();
	private TextString linha2 = new TextString();
	
	private final ExtendedInternalCollection notasfiscais = new ExtendedInternalCollection(
			"Notasfiscais", NotaFiscal.class, this);
	
	public ExtendedInternalCollection getNotasfiscais() {
		return notasfiscais;
	}
	
	public TextString getLinha1() {
		return linha1;
	}
	
	public TextString getLinha2() {
		return linha2;
	}
	
	public Title title() {
		return new Title(getLinha1().title().toString() + ", " + getLinha2().title().toString());
	}
}
